package com.shopreg.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="SHOP_MENU_CATEGORY")
public class ShopMenuCategory {

	private int categoryId;
	private ShopDetails shopDetails;
	private String categoryName;
	private String categoryType;
	private String categoryDescription;
	private Set<ShopMenuItems> shopMenuItems = new HashSet<ShopMenuItems>();
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "CATEGORY_ID")
	public int getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SHOP_ID")
	public ShopDetails getShopDetails() {
		return shopDetails;
	}
	public void setShopDetails(ShopDetails shopDetails) {
		this.shopDetails = shopDetails;
	}
	@Column(name = "CATEGORY_NAME")
	public String getCategoryName() {
		return categoryName;
	}
	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	@Column(name = "CATEGORY_TYPE")
	public String getCategoryType() {
		return categoryType;
	}
	public void setCategoryType(String categoryType) {
		this.categoryType = categoryType;
	}
	@Column(name = "CATEGORY_DESCRIPTION")
	public String getCategoryDescription() {
		return categoryDescription;
	}
	public void setCategoryDescription(String categoryDescription) {
		this.categoryDescription = categoryDescription;
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "shopMenuCategory")
	public Set<ShopMenuItems> getshopMenuItems() {
		return shopMenuItems;
	}
	public void setshopMenuItems(Set<ShopMenuItems> shopMenuItems) {
		this.shopMenuItems = shopMenuItems;
	}
	
	
}
